﻿#region Using
/*
=============================================================================
Author:魏宝辉通过CodeSmithe生成
CreatedTime:2012-12-6
Description:BPM_IPWhiteList.aspx.cs页面代码
=============================================================================	
*/

using System;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using FineUI;
using FTchina.Logic;
using FTchina.Library;
#endregion
public partial class BPM_TZGL_CODELIMITListaction_cs : BasePage
{



    protected void Page_Load(object sender, EventArgs e)
    {

        if (!IsPostBack)
        {
            LoadData();
             
        }

    }
    private void LoadData()
    {

        // 关闭按钮的客户端脚本：
        // 1. 首先确认窗体中表单是否被修改（如果已经被修改，则弹出是否关闭的确认对话框）
        // 2. 然后关闭本窗体，回发父窗体
        btnClose.OnClientClick = ActiveWindow.GetConfirmHidePostBackReference();
        txbendtime.SelectedDate = DateTime.Now.AddDays(1); //默认增加一天

    }
     
    protected void btnSaveContinue_Click(object sender, EventArgs e)
    {
        PWMIS.DataProvider.Data.AdoHelper adohelper = PWMIS.DataProvider.Adapter.MyDB.GetDBHelperByConnectionName("BPMDB");
         // 1. 这里放置保存窗体中数据的逻辑
        FTchina.Models.BPM_TZGL_CODELIMIT Model = new FTchina.Models.BPM_TZGL_CODELIMIT();
        Model.CODE=txbcode.Text.Trim();

        Model.STRDATE = txbstrdate.Text.Trim();
        Model.ENDTIME = Convert.ToDateTime(txbendtime.Text.Trim());        
        Model.UNAME = MasterHelper.UName;

        string sql = "insert into DY_ZHGL_TZGL_LIMIT (code,endtime,strdate,uname) values ('" + Model.CODE + "',to_date('"+Model.ENDTIME+"' , 'yyyy-mm-dd hh24:mi:ss'),'" + Model.STRDATE + "','" + Model.UNAME + "')";
        AlertLogic.ShowResult(adohelper.ExecuteNonQuery(sql)!=-1);

        //AlertLogic.ShowResult(FTchina.DAL.BPM_TZGL_CODELIMITService.AddOrUpdateBPM_IPWhiteList(Model, adohelper) > 0);

        // 2. 关闭本窗体，然后回发父窗体
        PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
    }
    //protected void btnSaveRefresh_Click(object sender, EventArgs e)
    //{
    //    // 1. 这里放置保存窗体中数据的逻辑

    //    // 2. 关闭本窗体，然后刷新父窗体
    //    PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
    //}






}






